<table class="table table-striped">
  <thead>
    <tr>
      <th><%= Radacct.human_attribute_name(:username) %></th>
      <th><%= Radacct.human_attribute_name(:ipmac) %></th>
      <th><%= Radacct.human_attribute_name(:acctstarttime) %></th>
      <th><%= Radacct.human_attribute_name(:acctsessiontime) %></th>
      <th><%= Radacct.human_attribute_name(:location) %></th>
      <th><%= Radacct.human_attribute_name(:traffic) %></th>
    </tr>
  </thead>

  <tbody>
    <% @radaccts.each do |radacct| %>
      <tr>
        <td><%= radacct.username %></td>
        <td>
            Ip: <%= radacct.framedipaddress %> <br />
            Mac: <%= radacct.callingstationid %>
        </td>
        <td><%= radacct.acctstarttime.to_formatted_s(:db) %></td>
        <td><%= distance_of_time_in_words radacct.acctsessiontime %></td>
        <td><%= radacct.hotspot_name %></td>
        <td>
            <%= Radacct.human_attribute_name(:acctinputoctets) %>: <%= number_to_human_size radacct.acctinputoctets %> |
            <%= Radacct.human_attribute_name(:acctoutputoctets) %>: <%= number_to_human_size radacct.acctoutputoctets %> |
            <%= Radacct.human_attribute_name(:traffic_total) %>: <%= number_to_human_size(radacct.acctinputoctets + radacct.acctoutputoctets ) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= paginate @radaccts %>
